import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "layout",
    component: () => import("@/views/layout/index.vue"),
    children: [
      {
        path: "/",
        name: "home",
        component: () => import("@/views/home/index.vue"),
      },
      {
        path: "/product",
        name: "product",
        component: () => import("@/views/product_manage/index.vue"),
        children: [
          {
            path: "/product_list",
            name: "product_list",
            component: () => import("@/views/product_manage/list/index.vue"),
          },
          {
            path: "/product_category",
            name: "product_category",
            component: () =>
              import("@/views/product_manage/category/index.vue"),
          },
        ],
      },
      {
        path: "/order",
        name: "order",
        component: () => import("@/views/order_manage/index.vue"),
        children: [
          {
            path: "/order_list",
            name: "order_list",
            component: () => import("@/views/order_manage/list/index.vue"),
          },
          {
            path: "/order_checklist",
            name: "order_checklist",
            component: () => import("@/views/order_manage/checklist/index.vue"),
          },
          {
            path: "/order_audit",
            name: "order_audit",
            component: () => import("@/views/order_manage/audit/index.vue"),
          },
        ],
      },
      {
        path:'/advertisement',
        name:'advertisement',
        component:()=>import('@/views/advertiselment_classification/index.vue'),
        children:[
          {
            path:"/advertisement_list",
            name:'path:/advertisement_list',
            component:()=>import('@/views/advertiselment_classification/list/index.vue')
          }
        ]
      }
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login/index.vue"),
  },
];

const router = new VueRouter({
  routes,
});

export default router;
